PROJ_02

URL SHORTENER
& ANALYTICS

Distributed URL shortening platform using Base62 encoding, Redis caching, PostgreSQL persistence and a real-time analytics dashboard.

JAVA SPRING BOOT ANGULAR POSTGRESQL REDIS DOCKER

OVERVIEW

This platform converts long URLs into compact Base62 encoded links and provides detailed analytics on usage patterns. The application uses Redis as a caching layer above PostgreSQL, achieving an 85%+ cache hit ratio while reducing read latency by approximately 60%. The system also includes a real-time analytics dashboard built with Angular for tracking redirects, traffic and usage metrics.

ARCHITECTURE


+----------------------+
|       USER           |
+----------+-----------+
           |
           v

+----------------------+
|     ANGULAR UI       |
+----------+-----------+
           |
           v

+----------------------+
|  SPRING BOOT API     |
+----------+-----------+
           |
           v

+----------------------+
|     REDIS CACHE      |
+----------+-----------+
           |
      Cache Hit?
           |
     +-----+-----+
     |           |
    YES         NO
     |           |
     v           v

 Response   +------------------+
            |   POSTGRESQL     |
            +--------+---------+
                     |
                     v

            Update Redis Cache

BASE62_ENCODING

Long URLs are converted into compact short URLs using a Base62 encoding strategy. Each generated identifier uses:

0-9 → 10 characters
a-z → 26 characters
A-Z → 26 characters

Total = 62 possible symbols

This allows millions of unique URLs while maintaining compact link sizes.

KEY_FEATURES

Base62 Encoding

Generates compact unique URLs using efficient Base62 conversion.

Redis Caching

Frequently accessed URLs are served directly from Redis.

Analytics Dashboard

Real-time tracking of clicks, redirects and URL usage metrics.

Docker Deployment

Fully containerized application supporting consistent deployments.

REDIS_CACHE_LAYER

  1. 1. Request arrives with short URL.
  2. 2. Redis lookup is performed.
  3. 3. Cache Hit → URL returned immediately.
  4. 4. Cache Miss → PostgreSQL queried.
  5. 5. Result stored back into Redis.
  6. 6. Future requests become Cache Hits.

ANALYTICS_DASHBOARD

Total Clicks

Tracks overall redirect volume.

Popular Links

Identifies highest traffic URLs.

Usage Metrics

Provides real-time analytics insights.

PERFORMANCE

85%+

CACHE HIT RATIO

60%

LATENCY REDUCED

DOCKER

CONTAINERIZED

ENGINEERING_CHALLENGES

URL Uniqueness

Designing a short URL generation strategy that avoids collisions while maintaining compact identifiers. Base62 encoding was implemented to support a large number of unique URLs without increasing link length.

Database Load

Redirect requests are highly read-intensive. Redis was introduced as a caching layer above PostgreSQL, significantly reducing database load and improving response times.

Real-Time Analytics

Click events needed to be captured and reflected within the analytics dashboard while maintaining responsive redirect performance.

PROJECT_RESULTS

85%+

Cache Hit Ratio

60%

Read Latency Reduction

Docker

Containerized Deployment

LESSONS_LEARNED

Building this project strengthened my understanding of caching strategies, database optimization, REST API design, frontend-backend integration and distributed application architecture. It also provided hands-on experience working with Redis, PostgreSQL, Docker and Angular in a production-style full-stack environment.

VIEW_SOURCE_CODE

Explore the implementation, architecture and source code.

OPEN_GITHUB